<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <link rel="stylesheet" href="/styles/common.css"/>
    </head>
    <body>
         <#include "top.ftl">
        <div class="page-body">
            <#include "leftmenu.ftl">
            <div class="page-content">
                <div class="content-nav">
                    修改密码
                </div>
                <form action="changepwup" method="post">
                    <fieldset>
                        <legend>修改密码信息</legend>
                        <table class="formtable" style="width:50%">
                            <tr>
                                <td>原密码:</td>
                                <td>
                                    <input name="password" id="origin" type="password"/>
                                </td>
                            </tr>
                            <tr>
                                <td>新密码:</td>
                                <td>
                                    <input name="newpassword" id="new" type="password" />
                                </td>
                            </tr>
                            <tr>
                                <td>确认新密码：</td>
                                <td>
                                    <input id="confirm" type="password" onchange="check()"/>
                                    <div id="confirminfo" style="color: red"></div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="command">
                                    <input id="submitbutton" type="submit" value="确认修改" class="clickbutton"/>
                                    <input type="button" value="返回" class="clickbutton" onclick="window.history.back();"/>
                                    <#if faild??>
                                        <span style="color:red;">${faild}</span>
                                    </#if>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </form>
            </div>
        </div>
        <div class="page-footer">
            <hr/>

        </div>
         <script>
             function check(){
                 var password = document.getElementById("new");
                 var confirm = document.getElementById("confirm");
                 var confirminfo = document.getElementById("confirminfo");
                 var submitbutton = document.getElementById("submitbutton");
                 if(password.value != confirm.value){
                     confirminfo.innerHTML = "两次输入的密码不一致";
                     submitbutton.disabled = true;
                 }else{
                     confirminfo.innerHTML = "";
                     submitbutton.disabled = false;
                 }
             }
         </script>
    </body>
</html>